﻿using DotNetty.Buffers;
using QQ.Client;

namespace QQ.Packet.Request.TLV
{
    public class TLV0x100 : IRequest
    {
        private readonly QQDeviceConfig config;
        private short db_buf_ver { get; set; } = 1;
        private int sso_ver { get; set; } = 5;
        private int sigMap { get; set; } = 34869472;
        public TLV0x100(QQDeviceConfig config)
        {
            this.config = config;
        }
        public IByteBuffer Serialize() => Unpooled.Buffer()
            .WriteShort(db_buf_ver)
            .WriteInt(sso_ver)
            .WriteInt((int)config.appId)
            .WriteInt((int)config.subAppId)
            .WriteInt(config.appClientVersion)
            .WriteInt(sigMap);
    }
}